﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace ZoneLine.Views
{
    public class ConvertHelper
    {
        public static void ConvertColumnHeader(DataGridAutoGeneratingColumnEventArgs e)
        {
            if (e.PropertyDescriptor is PropertyDescriptor ss)
            {
                if (string.IsNullOrEmpty(ss.Description))
                {
                    e.Cancel = true;
                }
                e.Column.Header = ss.Description;
            }
            else
            {
                e.Column.Header = e.PropertyName;
            }
        }
    }
}
